Using Euclids Extended Algorithm:
Calculate x and y in Bézout's Identity
using (7,15)
For 2 numbers a and b and divisor d:
ax + by = d
a math | a | b math | b | d math | d | k math | k |
---|---|---|---|---|---|---|---|
Set to 1 | 1 | Set to 0 | 0 | 7 | |||
Set to 0 | 0 | Set to 1 | 1 | 15 | Quotient of 7/15 | 0 | |
1 - (0 x 0) | 1 | 0 - (0 x 1) | 0 | Remainder of 7/15 | 7 | Quotient of 15/7 | 2 |
0 - (2 x 1) | -2 | 1 - (2 x 0) | 1 | Remainder of 15/7 | 1 | Quotient of 7/1 | 7 |
1 - (7 x -2) | 15 | 0 - (7 x 1) | -7 | Remainder of 7/1 | 0 | Quotient of 1/0 | 0 |
a = -2 and b = 1
ax + by = gcd(a,b)
7x + 15y = gcd(7